package org.linlinjava.litemall.db.service;

import org.linlinjava.litemall.db.dao.AgedmallExplainMapper;
import org.linlinjava.litemall.db.dao.app.AppExplainMapper;
import org.linlinjava.litemall.db.domain.AgedmallExplain;
import org.linlinjava.litemall.db.domain.AgedmallExplainExample;
import org.linlinjava.litemall.db.vo.app.ExplainDto;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class AgedmallExplainService {

    @Resource
    private AgedmallExplainMapper agedmallExplainMapper;
    @Resource
    private AppExplainMapper appExplainMapper;

    public AgedmallExplain findByBusId(long busId, Integer type) {
        AgedmallExplainExample example = new AgedmallExplainExample();
        example.createCriteria().andBusIdEqualTo(busId)
                .andTypeEqualTo(type);
        return agedmallExplainMapper.selectOneByExample(example);
    }

    public List<AgedmallExplain> findByStoreIds(List<ExplainDto> explainDtos) {
        return appExplainMapper.findByStoreIds(explainDtos);
    }
}
